﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.SongsDataSource"
	xmlns:controls="clr-namespace:ToyundaPhone.Controls"
	xmlns:SampleData1="clr-namespace:Expression.Blend.SampleData.PlaylistsDataSource" 
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	x:Name="phoneApplicationPage" 
	x:Class="ToyundaPhone.Pages.FavoritesPage"
	SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
	mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
	shell:SystemTray.IsVisible="True" OrientationChanged="PhoneApplicationPage_OrientationChanged">
	<phone:PhoneApplicationPage.Resources>
		<SampleData:SongsDataSource x:Key="SongsDataSource" d:IsDataSource="True"/>
		<SampleData1:PlaylistsDataSource x:Key="PlaylistsDataSource" d:IsDataSource="True"/>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBar.MenuItems>
				<shell:ApplicationBarMenuItem IsEnabled="True" Text="Choisir liste d'ajout" Click="ChooseList_Click"/>
			</shell:ApplicationBar.MenuItems>
			<shell:ApplicationBarIconButton IconUri="/icons/appbar.lists.rest.png" IsEnabled="True" Text="Listes" Click="Playlists_Click"/>
			<shell:ApplicationBarIconButton IconUri="/icons/appbar.delete.rest.png" IsEnabled="True" Text="Vider" Click="Empty_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource ApplicationNameUC}" Style="{StaticResource PhoneTextNormalStyle}"/>
			<TextBlock x:Name="PageTitle" Text="favoris" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
		</StackPanel>

		<controls:SongListControl x:Name="songList" ViewType="Favorites" Grid.Row="1" Margin="12,0,12,0" d:DataContext="{Binding Source={StaticResource SongsDataSource}}" DataContext="{Binding ElementName=phoneApplicationPage}" ListUpdated="SongList_ListUpdated" EmptyForeground="{StaticResource PhoneForegroundBrush}" EmptyText="Pas de favoris." SelectPlaylist="SongList_SelectPlaylist" />
		<toolkit:ListPicker x:Name="listPicker" Visibility="Collapsed" d:DataContext="{Binding Source={StaticResource PlaylistsDataSource}}" DataContext="{Binding ElementName=phoneApplicationPage}" ItemsSource="{Binding Playlists}" ItemTemplate="{StaticResource PlaylistPickerDataTemplate}" Header="Sélectionnez une liste" ExpansionMode="FullScreenOnly" SelectionChanged="ListPicker_SelectionChanged" FullModeItemTemplate="{StaticResource PlaylistPickerDataTemplate}" />
	</Grid>
</phone:PhoneApplicationPage>
